var fdsearch=document.querySelector(".fdsearchWrap");
var dtdh=document.querySelector(".dtdh");
var fdright=document.querySelector(".fdright");
var search=document.querySelector(".search");
var fh=document.querySelector(".fh");
var dt=document.querySelector(".dt");
var bjarr=Array.from(document.querySelectorAll(".biaoji"));
// console.log(bjarr)
fh.onclick=function(){
    document.documentElement.scrollTop=0;
}
document.onscroll=function(e){
    // console.log(dtdh.offsetTop-80,document.documentElement.scrollTop)
    if(document.documentElement.scrollTop>search.offsetHeight){
        fdsearch.style.display="block";
    }else{
        fdsearch.style.display="none";
    }
    if(document.documentElement.scrollTop>=620){
        dtdh.style.position="fixed";
        dtdh.style.top="60px";
        fdright.style.position="fixed";
        fdright.style.top="60px";
    }
    else{
        dtdh.style.position= "absolute";
        fdright.style.position="absolute"
        dtdh.style.top="700px";
        fdright.style.top="700px";
    }
}
// bjarr.forEach(function(item){
//     console.log(item.parentElement.offsetTop)
// })
dt.onclick=function(e){
    if(e.target.nodeName!=="LI")return;
    bjarr.forEach(function(item){
        if(item.innerHTML===e.target.innerHTML)
        var offsetTop=item.parentElement.offsetTop-30;
        $('html,body').animate({
            scrollTop: offsetTop
          },300)
    })
}
